<template>
  <a-config-provider :locale="locale">
    <div id="app">
      <router-view />
    </div>
  </a-config-provider>
</template>

<script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN';
export default {
  mounted() {
    if (window.self !== window.parent) {
      //接受iframe父页面传递来的专家领域数据
      window.addEventListener("message", this.receiveMessage, false);
    }
  },
  methods: {
    receiveMessage(e) {
        if(typeof e.data === 'string'){
          try {
            // console.log(JSON.parse(e.data));
            window.localStorage.setItem('parentMsgData', e.data);
          }
          catch(err){
            console.log(err)
          }
        }
    }
  },
  data() {
    return {
      locale: zhCN
    };
  }
};
</script>
<style lang="less"></style>
